﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PetaPoco;
namespace ZhongheCms.Models
{
    public partial class GswTblBaseInfo
    {
        [ResultColumn]
        public List<GswTblBaseInfo>  BaseInfos { get; set; }

        public static string GetMasterTypeName(int id)
        {
            var typename = "";
            var qry = SingleOrDefault(id);
            if (qry != null)
                typename = qry.MasterType;
            return typename;
        }
        public static string GetMasterTypeName(List<GswTblBaseInfo> baseInfos,int id)
        {
            var typename = "";
            var qry = baseInfos.SingleOrDefault(x=>x.Id==id);
            if (qry != null)
                typename = qry.MasterType;
            return typename;
        }
    }
}